<?php get_backend_header(array(
	'jquery/validate/jquery.validate.js',
        'jquery/validate/additional-methods.js',
	'exam.js',
), array(
	'jquery/ui.jqgrid.css'
)); ?>

<?php get_group_sidebar($group_id); ?>
<div id ="content" >
    <h2 class="title"><?php echo $exam['exam_name'] ?> -  Exam Details</h2>

    <form id="exam_details_form" name="exam_details_form" class="form">
            <input type="hidden" id="exam_id" name="exam_id" value="<?php echo $exam_id; ?>" />
            <input type="hidden" id="group_id" name="group_id" value="<?php echo $group_id; ?>" />

                <div class="unit">
                    <?php for($i = 1; $i <= $exam['no_of_terms']; $i++  ) { ?>
                    <div class="line">
                            <label for="" class="bold"><?php echo $i ?>. Question:</label>
                            <div class="field" style="height:auto; width:150px">
                              <input style ="width:100px" type="text" name="terms_<?php echo $i ?>" id="terms_<?php echo $i ?>" value="" />
                            </div>
                    </div>
                    <?php  } ?>
                </div>

                <div class="unit">
                    <?php for($i = 1; $i <= $exam['no_of_terms']; $i++  ) { ?>
                    <div class="line">
                            <label for="" class="bold">Answer:</label>
                            <div class="field" style="height:auto; width:150px">
                              <input style ="width:100px" type="text" name="definition_<?php echo $i ?>" id="definition_<?php echo $i ?>" value="" />
                            </div>
                    </div>
                    <?php  } ?>
                </div>


            <div class ="clear"></div>

            <div class="buttons">
                <button id="save" name="save">Save</button>
            </div>
    </form>
    
</div>


<script type="text/javascript">
        examDetailsRules();

        $(':input').addClass('required');
	
	$('#save').button({
		icons: {primary: 'ui-icon-disk'}
	}).click(function(e) {
                e.preventDefault();
		$(this).removeClass('ui-state-focus');
		$('#exam_details_form').submit();
	});

</script>

<?php get_backend_footer(); ?>
